package com.lw.question10;

import java.util.Scanner;

/**
 * @author LW
 * @2020/9/17 13:49
 */
public class 闰年1 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int year = scanner.nextInt();
        int month = scanner.nextInt();
        switch (month){
            case 1:
                System.out.println(31);
            case 2:
                if ((year % 4==0 && year % 100!=0) || year % 400== 0){
                    System.out.println(28);
            }else {
                    System.out.println(29);
                }
            case 3:
                System.out.println(31);
            case 4:
                System.out.println(30);
            case 5:
                System.out.println(31);
            case 6:
                System.out.println(30);
            case 7:
                System.out.println(31);
            case 8:
                System.out.println(31);
            case 9:
                System.out.println(30);
            case 10:
                System.out.println(31);
            case 11:
                System.out.println(30);
            case 12:
                System.out.println(31);

        }

    }
}
